1. Field of the Invention
The present invention relates generally to an antialiasing method and an image processing apparatus using the same, and more particularly to an antialiasing method capable of a high-quality image display without causing any significant reduction in processing speed and any increase in apparatus scale.
2. Description of the Related Arts
In recent image processing systems such as game machines making use of computer graphics, it is desired to enhance the virtual realities through high-quality and high-speed displays of graphics having three-dimensional coordinates, on a two-dimensional screen such as a CRT composed of a multiplicity of display elements (pixels).
In such image processing systems, graphics to be displayed in the three-dimensional space are regarded as accumulations of polygons (polygonal surfaces), so that use is made of attribute data (hereinafter, referred to as polygon data) possessed by the polygons to create and display final two-dimensional images.
The polygon data is typically polygon vertex data including three-dimensional coordinate values of each vertex in a predetermined three-dimensional space, vertex colors, texture mapping coordinate addresses, vertex transparencies, and vertex normal vectors, etc.
FIG. 14 illustrates a schematic configuration of the image processing system. Description will hereinbelow be made of a flow of typical processing effected to display images on the screen. In FIG. 14, a CPU 1 provides a control of entire functions of the image processing apparatus and performs a management of game sequences for example. A RAM 7 stores therein programs, data and display lists, etc, for use in the CPU 1.
The polygon data is fed to a geometry computing unit 2 in which it is subjected to processings such as coordinate transformation and perspective transformation, for the conversion into two-dimensional data corresponding to the display screen. The thus converted polygon data is stored in a polygon buffer 8.
A hidden-surface processing unit 3 then executes a hidden-surface removal (hereinafter, referred to as hidden-surface processing) by use of the polygon data. In cases where a plurality of polygons are superposed, one upon another, at the same site on the two-dimensional screen, it is necessary to judge which polygons are actually visible from the user""s eyes. The hidden-surface processing makes such judgment to determine the range of each polygon to be displayed.
In response to the results of the hidden-surface processing, a rendering unit 4 then converts the polygon data into pixel based data. This processing is called rendering. For the data converted on a pixel-by-pixel basis (hereinafter referred to simply as pixel data), a texture unit 5 and a shading unit 6 execute texture mapping and shading processes, respectively. A texture buffer 9 stores therein texture data and provides data corresponding to the pixel texture mapping coordinate addresses, allowing texture mapping to be effected on a pixel-by-pixel basis.
Through these steps, determination of the pixel based data such as display colors is complete of each polygon. Using such data, a blending unit 10 defines finally the colors to be displayed on the screen, on a pixel-by-pixel basis. More specifically, in cases where for example a plurality of polygons share a single pixel (i.e., where the pixel includes plural pieces of valid pixel data) with pixels being translucent, the color data is produced from a values possessed by the respective pixels, to determine the final pixel display color.
The image data created on xcex1 pixel basis is written to the frame buffer 11. The frame buffer 11 feeds the data as frame images to a display unit for final display of the images.
Although images are displayed on the CRT or the like through the above processing steps, such digitized images represent the images in the form of the aggregate of pixels (the set of rectangles), intrinsically suffering from the problem of aliasing. This state is shown in FIGS. 15A to 15C.
FIGS. 15A to 15C illustrate by way of example the case where a graphic of FIG. 15A is desired to represent. Even in the case of internally possessing information on a theoretically correct geometry as shown in FIG. 15A, once it is represented as the aggregate of pixels, diagonal lines such as the triangular polygon edges for example may result in a stepwise display as indicated in FIG. 15B. This is due to the fact that a single color is used to represent the entire pixel within which the color may internally (theoretically) vary. This is a problem intrinsically difficult to solve as long as the digital images are represented as the aggregates of pixels.
In particular, in cases where without taking any measures thereagainst, the color possessed internally by a representative point (e.g., a pixel center) within a pixel is regarded as the pixel color for processing as in the prior art, the above stepwise display will become remarkable.
Such a problem could however be solved to a substantially (visually) negligible extent by combining plural pieces of color data originally internally possessed by a pixel to determine the display color of that pixel. The processing therefor is called antialiasing. The graphic of FIG. 15C is an example of the display image obtained when subjected to the antialiasing processing.
It is one key function for the creation of highly realistic, high-quality images to execute such antialiasing processing.
This means that the antialiasing processing is indispensable for any image processing systems such as game machines since it ensures high-quality images in a pseudo-manner without using any high-resolution monitor.
For the determination of one pixel color in the antialiasing processing, however, it is necessary to generate information on a plurality of colors associated with the pixel and information on positions of those colors within the pixel and to make a certain calculation by use of them. For this reason, the antialiasing processing has hitherto been regarded as generally heavy processing, inevitably bringing about any increase in the processing time and system scale for the acquisition of high-quality images.
In order to alleviate such a drawback, a variety of measures have been adopted, although all the measures are not free from any deficiencies. The translucent edge technique commonly used in, e.g., personal computers is a color synthesizing technique in which transparency is determined depending on the proportions of the area occupied by polygons in a pixel within which polygon edges lie.
Although this technique is advantages in terms of the processing speed and system scale, it is problematic from the viewpoint of quality since the picture may often break or background colors may remain left. This arises from the fact that all the polygons are treated as translucent at their edge portions, so that the edge portions are not to be subjected to correct hidden-surface processing in the hidden-surface processing unit 3 described above.
An alternative conventional technique is an over-sampling method. In this technique, processing is, made at a higher resolution than a display resolution on the screen and averaging is made immediately before the display, to obtain the display resolution. More specifically, this is a method in which the entire process steps up to the frame buffer 11 described above are executed on the basis of a smaller rectangle (subpixel) than the pixel size to be displayed.
This method is advantageous in that with its simple concept, the above-described standard processing steps need not substantially be changed and that a fairly high-quality is expected, although the amount of data to be processed increases in proportion to the number of subpixels, resulting in an increase in processing time and in system dimensions.
Some other methods than the above-described techniques have also been conceived, but none of them have presented well-balanced results in terms of the processing speed, image qualities, and system scale insofar as the game systems are practical.
It is therefore the object of the present invention to provide, in view of the above problems, an antialiasing method and an image processing apparatus using the same, capable of a high-quality image display without any significant reduction in processing speed or any significant increase in the apparatus scale.
In order to achieve the above object, a first aspect of the present invention provides an antialiasing method in which pixel data is caused to contain information on a subpixel mask indicative of region occupied by a polygon in a pixel and in which a display color is determined on a pixel-by-pixel basis, from data sets consisting of the subpixel masks and color data contained in the pixel data. According to the present invention, therefore, it is possible to implement subpixel based, high-quality antialiasing processing.
In a preferred mode of the present invention, the above pixel-based determination of display colors may be executed by combining a plurality of data sets consisting of color data and subpixel masks with one another, the number of data sets being less than the number of subpixels constituting one pixel.
In another mode, plural pieces of color data and a plurality of subpixel masks for determination of the display colors may be obtained by iterating predetermined processing for the color data and the subpixel masks until the pixel data valid for the subject pixel becomes absent.
In a further mode, the subpixel masks may be created through a hidden-surface processing step which includes, for each of scanning lines constituting the display screen, sorting a plurality of polygons whose edges intersect each scanning line, based on specific positions of said polygons in X-axis direction of the scanning lines, and further sorting the sorted polygons on the basis of Z-coordinate values of the polygons, the hidden-surface processing being performed on a subpixel-by-subpixel basis, and through a step of making the results of said hidden-surface processing into a pixel-by-pixel basis.
In order to attain the above object, a second aspect of the present invention provides an image processing apparatus comprising a subpixel mask creating unit for creating subpixel masks to add information thereof to pixel data; and a blending unit for processing data sets consisting of the subpixel masks and color data contained in the pixel data, to determine a display color on a pixel-by-pixel basis. According to the present invention, therefore, it is possible to implement subpixel based, high-quality antialiasing processing.
In a preferred mode of the present invention, the image processing apparatus may comprise color buffers and mask buffers, the number of both of which is less than the number of subpixels constituting one pixel.
In another mode, the subpixel mask creating unit may comprise a hidden-surface processing unit for performing hidden-surface processing on a subpixel-by-subpixel basis, the hidden-surface processing including, for each of scanning lines constituting said display screen, sorting a plurality of polygons whose edges intersect each scanning line, based on specific positions of the polygons in X-axis direction of the scanning lines, and further sorting the sorted polygons on the basis of Z-coordinate values of the polygons; and a rendering unit for making the results of processing effected by the hidden-surface processing unit into a pixel based data.
In a further mode, the hidden-surface processing unit may comprise Y sorters, a subline segmenting unit, X sorters the number of which is equal to the number of sublines lying within one scanning line, and Z sorters the number of which is equal to the number of the X-sorters. The rendering unit may comprise a subline queuing/pixel making unit.
The above and other objects, aspects, features and advantages of the present invention will become more apparent from the following detailed description of a preferred embodiment thereof.